#include "gPlayer.h"

void gPlayer::input()
{
	if(m_phyObj)
	{
		float mvspd = 400*clkMesh::m_time->getElapsed();
		float rtspd = 200*clkMesh::m_time->getElapsed();

		if(m_din->keyInput(KEY_W))
			m_phyObj->addVelocity(m_look.x*mvspd,m_look.y*mvspd,m_look.z*mvspd);
		if(m_din->keyInput(KEY_S))
			m_phyObj->addVelocity(-m_look.x*mvspd,-m_look.y*mvspd,-m_look.z*mvspd);

		if(m_din->keyInput(KEY_A))
			m_rot.y -= rtspd;
		if(m_din->keyInput(KEY_D))
			m_rot.y += rtspd;

		if(m_rot.y < 0.0f)
			m_rot.y += 360.0f;
		else if(m_rot.y > 360.0f)
			m_rot.y -= 360.0f;
	}

	gShip::input();
}